#include "qelib.h"
#include "qe_driver.h"
#include "libfdt.h"

QELOG_DOMAIN("test1");

static qe_ret test1_probe(const void *fdt, int offset)
{
    const char *name;
    const char *parent_name;
    qe_notice("probe");
    name = fdt_get_name(fdt, offset, QE_NULL);
    qe_notice("name %s", name);
    int parent = fdt_parent_offset(fdt, offset);
    parent_name = fdt_get_name(fdt, parent, QE_NULL);
    qe_notice("parent %s", parent_name);
    return qe_ok;
}

static const qe_device_id test1_ids[] = {
	{.compatible = "test,driver",},
    {.compatible = "gas320,fm",},
    {}
};

QE_DRIVER(test1) = {
    .name = "test1",
    .of_match = test1_ids,
    .probe = test1_probe,
};